import React from 'react'
import { Modal, Button } from 'antd-mobile'

function ErrorMessage(props) {
  const { content, close } = props

  return (
    <div className="error-message">
      <Modal
        visible={!!content}
        onClose={close}
        transparent
        title=""
        className="error-message--modal"
      >
        <p>
          <img src={require('../../assets/images/sorry.png')} alt=""/>
        </p>
        <p className="content">
          {content}
        </p>
        <p>
          <Button type="warning" onClick={close}>我知道了</Button>
        </p>
      </Modal>
    </div>
  )
}

export default ErrorMessage
